package com.gduf.lsm.mapper;

import com.gduf.lsm.common.annotation.AutoFill;
import com.gduf.lsm.common.enums.OperationType;
import com.gduf.lsm.entity.ApplyNum;
import com.gduf.lsm.pojo.dto.ApplyStatusDTO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
 * 操作applyNum相关数据接口
*/
@Mapper
public interface ApplyNumMapper {

    /**
     * 新增
     * @param applyNum
     * @return
     */
    @AutoFill(value = OperationType.INSERT)
    int insert(ApplyNum applyNum);

    /**
     * 删除
     * @param id
     * @return
     */
    int deleteById(Integer id);

    /**
     * 修改
     * @param applyNum
     * @return
     */
    @AutoFill(value = OperationType.UPDATE)
    int updateById(ApplyNum applyNum);

    /**
     * 根据ID查询
     * @param id
     * @return
     */
    @Select("select * from apply_num where id=#{id}")
    ApplyNum selectById(Integer id);

    /**
     * 查询所有
     * @param applyNum
     * @return
     */
    List<ApplyNum> selectAll(ApplyNum applyNum);

    /**
     * 修改表单状态
     * @param applyStatusDTO
     */
    @AutoFill(value = OperationType.UPDATE)
    void updateStatus(ApplyStatusDTO applyStatusDTO);
}